//
//  comentCell.m
//  YouGoWeGo
//
//  Created by 范业君 on 14-11-20.
//  Copyright (c) 2014年 LiuFei. All rights reserved.
//

#import "comentCell.h"

@implementation comentCell

- (void)dealloc
{
    [_aimage release];
    [_image release];
    [_name release];
    [_time release];
    [_comment release];
    [_reply release];
    [super dealloc];
}



- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.image = [[UIImageView alloc] initWithFrame:CGRectZero];
        [_image setBackgroundColor:[UIColor redColor]];
        [self.contentView addSubview:_image];
        [_image release];
        
        
        self.name = [[UILabel alloc] initWithFrame:CGRectZero];
        [_name setBackgroundColor:[UIColor redColor]];
        [self.contentView addSubview:_name];
        [_name release];
        
        
        self.comment = [[UILabel alloc] initWithFrame:CGRectZero];
        [_comment setBackgroundColor:[UIColor redColor]];
        [self.contentView addSubview:_comment];
        [_comment release];
        
        
        self.aimage = [[UIImageView alloc] initWithFrame:CGRectZero];
        [_aimage setBackgroundColor:[UIColor redColor]];
        [self.contentView addSubview:_aimage];
        [_aimage release];
        
        
        self.reply = [[UILabel alloc] initWithFrame:CGRectZero];
        [_reply setBackgroundColor:[UIColor redColor]];
        [_reply setText:@"回复"];
        [self.contentView addSubview:_reply];
        [_reply release];
    }
    return self;
}


- (void)layoutSubviews
{
    [super layoutSubviews];
    [_image setFrame:CGRectMake(10, 10, 30, 30)];
    
    
    [_name setFrame:CGRectMake(_image.frame.origin.x + _image.frame.size.width + 5, _image.frame.origin.y, 100, 20)];
    
    
    [_comment setFrame:CGRectMake(_name.frame.origin.x + _name.frame.size.width + 5, _name.frame.origin.y, 150, 30)];
    
    
    [_time setFrame:CGRectMake(_name.frame.origin.x, _name.frame.origin.y + _name.frame.size.height + 10, 20, 20)];
    
    
    [_aimage setFrame:CGRectMake(self.frame.size.width - 60, _name.frame.origin.y, 20, 20)];
    
    
    [_reply setFrame:CGRectMake(_aimage.frame.origin.x + _aimage.frame.size.width + 10, _aimage.frame.origin.y, 30, 30)];
    
    
    
}









- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
